#import "OmMineVCUserInformationView.h"
@interface OmMineVCUserInformationView ()
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIImageView *headBackgroundCircle;
@end
@implementation OmMineVCUserInformationView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self configSelf];
        [self allocateComponents];
        [self layoutComponents];
    }
    return self;
}
- (void)configSelf {
    [self mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(WINDOW_WIDTH));
        make.height.equalTo(@(RPX(190)));
    }];
}
- (void)allocateComponents {
    self.backgroundImageView = [[UIImageView alloc] initWithImage:IMAGE_NAMED(@"OmBg")];
    [self addSubview:self.backgroundImageView];
    self.headBackgroundCircle = [[UIImageView alloc] initWithImage:IMAGE_NAMED(@"circle")];
    [self addSubview:self.headBackgroundCircle];
    self.headImageView = [[UIImageView alloc] init];
    self.headImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.headImageView.layer.cornerRadius = RPX(38);
    self.headImageView.clipsToBounds = YES;
    [self addSubview:self.headImageView];
    self.nameLabel = [[UILabel alloc] init].fp_font(BoldRPXFont(19)).fp_textColor([UIColor whiteColor]);
    [self addSubview:self.nameLabel];
    self.onlineLabel = [[UILabel alloc] init].fp_font(BoldRPXFont(13)).fp_textColor([UIColor whiteColor]);
    [self addSubview:self.onlineLabel];
    self.ageLabel = [[UILabel alloc] init].fp_font(BoldRPXFont(13)).fp_textColor([UIColor whiteColor]);
    [self addSubview:self.ageLabel];
    self.memberImageView = [[UIImageView alloc] init].fp_contentMode(UIViewContentModeScaleAspectFit);
    [self addSubview:self.memberImageView];
}
- (void)layoutComponents {
    [self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(self);
    }];
    [self.headBackgroundCircle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.equalTo(@(RPX(91)));
        make.left.equalTo(self).offset(RPX(25));
        make.top.equalTo(self).offset(RPX(64));
    }];
    [self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.equalTo(@(RPX(76)));
        make.center.equalTo(self.headBackgroundCircle);
    }];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(RPX(74));
        make.left.equalTo(self).offset(RPX(135));
    }];
    [self.onlineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.top.equalTo(self.nameLabel.mas_bottom).offset(RPX(10));
    }];
    [self.ageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.onlineLabel);
        make.left.equalTo(self.onlineLabel.mas_right).offset(RPX(10));
    }];
    [self.memberImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.ageLabel);
        make.left.equalTo(self.ageLabel.mas_right).offset(RPX(10));
        make.width.height.equalTo(@(RPX(20)));
    }];
}
@end
